Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug 1772163: Stop retieving instances by state tag filter on API call #269

Merged

Conversation

enxebre
Copy link
Member

@enxebre enxebre commented Nov 14, 2019

This attempts to mitigate https://bugzilla.redhat.com/show_bug.cgi?id=1772163.
Instead of telling the API request to filter by state tag, we fetch all and discriminate only terminated instances client side.

@openshift-ci-robot
Copy link

@enxebre: This pull request references Bugzilla bug 1772163, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

bug 1772163: Stop retieving instances by state on API call

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Nov 14, 2019
@openshift-ci-robot
Copy link

@enxebre: This pull request references Bugzilla bug 1772163, which is valid.

In response to this:

bug 1772163: Stop retieving instances by state on API call

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 14, 2019
@enxebre
Copy link
Member Author

enxebre commented Nov 14, 2019

cc @bison @wking

@openshift-ci-robot
Copy link

@enxebre: This pull request references Bugzilla bug 1772163, which is valid.

In response to this:

bug 1772163: Stop retieving instances by state on API call

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@enxebre enxebre changed the title bug 1772163: Stop retieving instances by state on API call bug 1772163: Stop retieving instances by state tag filter on API call Nov 14, 2019
pkg/actuators/machine/utils.go Outdated Show resolved Hide resolved
pkg/actuators/machine/utils.go Outdated Show resolved Hide resolved
This attemps to mitigate https://bugzilla.redhat.com/show_bug.cgi?id=1772163. Instead of telling the API request to filter by state, we fetch all and discriminate only terminated instances
@enxebre enxebre force-pushed the stop-fetching-by-state branch from f8c0630 to c8e341f Compare November 14, 2019 12:55
Copy link

@bison bison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 14, 2019
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bison

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 14, 2019
@openshift-merge-robot openshift-merge-robot merged commit f68fb22 into openshift:master Nov 14, 2019
@openshift-ci-robot
Copy link

@enxebre: All pull requests linked via external trackers have merged. Bugzilla bug 1772163 has been moved to the MODIFIED state.

In response to this:

bug 1772163: Stop retieving instances by state tag filter on API call

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@wking
Copy link
Member

wking commented Nov 14, 2019

Uh, do you want me to rebase #267 and #268? Looks like you're doing part, but not all, of what I was doing in those.

@enxebre
Copy link
Member Author

enxebre commented Nov 14, 2019

Oh I missed those PRs @wking! sorry and thanks! I just had a look and I think both should be covered here but please rebase if you think otherwise. Thanks a bunch!

wking added a commit to wking/cluster-api-provider-aws that referenced this pull request Nov 14, 2019
…ancesOutput

So we can create pending, terminated, etc. instances for testing.
This should scale better than
stub{State}InstanceDescribeInstancesOutput from
openshift/cluster-api-provider-aws@c8e341f22f (Stop retieving
instances by state on API call, 2019-11-14,
openshift#269).
wking added a commit to wking/cluster-api-provider-aws that referenced this pull request Nov 14, 2019
…ceByID

openshift/cluster-api-provider-aws@c8e341f22f (Stop retieving
instances by state on API call, 2019-11-14,
openshift#269) did part of this.  This commit:

* Restores the instanceStateFilter argument to getInstanceByID, to
  avoid having two definitions (existingInstanceStates and a local !=
  Terminated in getExistingInstanceByID) that define what it means to
  exist.  This will also give us logged error messages like:

    instance i-123 state terminated is not in running, pending, stopped, stopping, shutting-down

  which will make it easier to find and fix omissions in
  existingInstanceStates.

* Adds a -running suffix to has-status-search-by-id, so it's easier to
  distinguish from the terminated case.

* Converts to the hyphenated has-status-search-by-id-terminated,
  instead of mixing hyphens and spaces in a case name.

* Uses inline argument for the DescribeInstances mocks, so we don't
  have to use request and request2.  These aren't so big that inlining
  them makes the mock setup unreadable.

* Returns an empty set of instances in the instance-listing fallback
  call in has-status-search-by-id-terminated (which we now require to
  happen after the by-ID call).  The list call is filtered by state,
  so it wouldn't return a terminated instance.
@wking
Copy link
Member

wking commented Nov 14, 2019

...rebase if you think otherwise...

Rebased each of them :).

enxebre pushed a commit to enxebre/cluster-api-provider-aws-2 that referenced this pull request Feb 20, 2020
…ancesOutput

So we can create pending, terminated, etc. instances for testing.
This should scale better than
stub{State}InstanceDescribeInstancesOutput from
openshift/cluster-api-provider-aws@c8e341f22f (Stop retieving
instances by state on API call, 2019-11-14,
openshift#269).
enxebre pushed a commit to enxebre/cluster-api-provider-aws-2 that referenced this pull request Feb 20, 2020
…ceByID

openshift/cluster-api-provider-aws@c8e341f22f (Stop retieving
instances by state on API call, 2019-11-14,
openshift#269) did part of this.  This commit:

* Restores the instanceStateFilter argument to getInstanceByID, to
  avoid having two definitions (existingInstanceStates and a local !=
  Terminated in getExistingInstanceByID) that define what it means to
  exist.  This will also give us logged error messages like:

    instance i-123 state terminated is not in running, pending, stopped, stopping, shutting-down

  which will make it easier to find and fix omissions in
  existingInstanceStates.

* Adds a -running suffix to has-status-search-by-id, so it's easier to
  distinguish from the terminated case.

* Converts to the hyphenated has-status-search-by-id-terminated,
  instead of mixing hyphens and spaces in a case name.

* Uses inline argument for the DescribeInstances mocks, so we don't
  have to use request and request2.  These aren't so big that inlining
  them makes the mock setup unreadable.

* Returns an empty set of instances in the instance-listing fallback
  call in has-status-search-by-id-terminated (which we now require to
  happen after the by-ID call).  The list call is filtered by state,
  so it wouldn't return a terminated instance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants